#!/bin/bash

ctreat_projects_into_group()
{
	#projects=`cat projects_list.done.txt`
	#for project in $projects
	#do
	#    info="name=$project&path=$project&wiki_enabled=no&public_jobs=true&public=true&namespace_id=17&default_branch=master&private_token=xGz_3hdmkA1Nbz_mv56g"
	#    curl -d $info "http://192.168.60.221/api/v4/projects"
	#done

	for i in `cat projects_list.done.txt`;
		do 
			echo "$i"
			curl --request POST --header "PRIVATE-TOKEN: xGz_3hdmkA1Nbz_mv56g"  --data "name=${i}&namespace_id=15" http://192.168.60.221/api/v4/projects;
		done

	echo
}

push_projects_into_group()
{
	dir_name="$PWD"
	all=`ls ${dir_name}`
	for i in $all
		do
			if [ -d $i ] 
			then
				echo "[$i]"
				cd $i
				git push --mirror git@192.168.60.221:rk3308repo_test/$i
				cd ..
			fi
		done 
}

push_projects_into_group

#end